|
In computer science, merge sort (also commonly spelled mergesort) is an efficient, general-purpose, comparison-based sorting algorithm. Most implementations produce a stable sort, which means that the implementation preserves the input order of equal elements in the sorted output. Mergesort is a divide and conquer algorithm that was invented by John von Neumann in 1945. A detailed description and analysis of bottom-up mergesort appeared in a report by Goldstine and Neumann as early as 1948. ==Algorithm== Conceptually, a merge sort works as follows: #Divide the unsorted list into ''n'' sublists, each containing 1 element (a list of 1 element is considered sorted). #Repeatedly merge sublists to produce new sorted sublists until there is only 1 sublist remaining. This will be the sorted list. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Merge sort」の詳細全文を読む スポンサード リンク
|